package com.yjqqq.test2;

import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        int[] ss = {1, 23, 123, 432, 5452, 1231, 231, 23, 12, 12};
        spe(0, ss.length - 1, ss);
        System.out.println(Arrays.toString(ss));

        Color color = Color.Red;
    }

    public static void spe(int lift, int right, int[] arr) {
        if (lift > right) {
            return;
        }
        int a = lift;
        int b = right;
        int len = arr[lift];
        while (a != b) {
            while (len <= arr[b] && a < b) {
                b--;
            }
            while (len >= arr[a] && a < b) {
                a++;
            }
            if (a < b) {
                int temp = arr[a];
                arr[a] = arr[b];
                arr[b] = temp;
            }
        }
        arr[lift] = arr[a];
        arr[a] = len;

        spe(lift, a - 1, arr);
        spe(a + 1, right, arr);

    }
}
